{include file='public/header' /}
<body class="login-bg">
    
    <div class="login layui-anim layui-anim-up">
        <div class="message">用户管理登录</div>
        <div id="darkbannerwrap"></div>
        
        <form method="post" class="layui-form" >
            <input name="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" id="username" value="">
            <hr class="hr15">
            <input name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input" id="password" value="">
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
            <hr class="hr20" >
        </form>
    </div>

    <script>
    var url = "{:url('index')}";
    layui.use('form',function(){
        var form = layui.form,$ = layui.jquery;
        //监听提交
        form.on('submit(login)', function(data){
            loading =layer.load(1, {shade: [0.1,'#fff'] });//0.1透明度的白色背景
            $.post(url,data.field,function(res){
                layer.close(loading);;
                if(res.code == 1){
                    layer.msg(res.msg, {icon: 1, time: 1000}, function(){
                        location.href = res.url;
                    });
                }else{
                    layer.msg(res.msg, {icon: 2, anim: 6, time: 1000});
                }
            },'json');
            return false;
        });
    });
    </script>

    
    <!-- 底部结束 -->

</body>
</html>